﻿<System.Serializable()> Public Class ImgControlItem

    Public Sub New()

    End Sub

    Public Function Clone() As ImgControlItem
        Dim img As New ImgControlItem

        img.ProjectID = _ProjectID
        img.Netid = _Netid
        img.Refid = _Refid
        img.PortNo = _PortNo
        img.RefType = _RefType

        img.ImageID = _ImageID
        img.DataType = _DataType
        img.TitleMsg = _TitleMsg
        img.TipMsg = _TipMsg
        img.UnitMsg = _UnitMsg

        img.cLeft = _cleft
        img.cTop = _cTop
        img.cHeight = _cHeight
        img.cWidth = _cWidth

        Return img
    End Function

    Public Sub New(ByVal apti As AiPortTypeItem, ByVal imageid As String, ByVal TipMsg As String)

        MyClass.New()

        _ProjectID = apti.ProjectID
        _Netid = apti.NetId
        _Refid = apti.RefId
        _RefType = apti.RefId
        _PortNo = apti.PortNo
        _ImageID = imageid
        _DataType = apti.DataType
        _TitleMsg = apti.PortName & ":"
        _TipMsg = TipMsg
        If apti.DataType = 1 Then
            _UnitMsg = "℃"
        ElseIf apti.DataType = 2 Then '湿度
            _UnitMsg = "%"
        ElseIf apti.DataType = 3 AndAlso apti.SeqPortNo = 15 Then '除霜温度
            _UnitMsg = "℃"
        End If
        _cleft = 0
        _cTop = 0
        _cWidth = 0
        _cHeight = 0
    End Sub

    '' 添加属性
    ''' <summary>
    ''' 指示是否是库门状态
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property IsDoorStatus() As Boolean
        Get
            Return _DataType = 4
        End Get
    End Property

    Public Sub New(ByVal diopti As DiDoPortTypeItem, ByVal imageid As String, ByVal TitleMsg As String, ByVal TipMsg As String)

        MyClass.New()

        _ProjectID = diopti.ProjectID
        _Netid = diopti.NetId
        _Refid = diopti.RefId

        If TitleMsg.IndexOf("冷库报警") <> -1 Then
            _PortNo = 1
        ElseIf TitleMsg.IndexOf("声光报警") <> -1 Then
            _PortNo = 2
        ElseIf TitleMsg.IndexOf("断电预警") <> -1 Then
            _PortNo = 3
        ElseIf TitleMsg.IndexOf("库门1预警") <> -1 Then
            _PortNo = 4
        ElseIf TitleMsg.IndexOf("库门2预警") <> -1 Then
            _PortNo = 5

        ElseIf TitleMsg.IndexOf("强制制冷开启状态") <> -1 Then
            _PortNo = 6
        ElseIf TitleMsg.IndexOf("强制制冷关闭状态") <> -1 Then
            _PortNo = 7
        ElseIf TitleMsg.IndexOf("联动报警") <> -1 Then
            _PortNo = 8
        ElseIf TitleMsg.IndexOf("除霜状态") <> -1 Then
            _PortNo = 9
            'ElseIf TitleMsg.IndexOf("联动状态") <> -1 Then
            '    _PortNo = 10
        ElseIf TitleMsg.IndexOf("发电机故障预警") <> -1 Then
            _PortNo = 10
        ElseIf TitleMsg.IndexOf("制冷状态") <> -1 Then
            _PortNo = 11
        ElseIf TitleMsg.IndexOf("机组故障预警") <> -1 Then
            _PortNo = 12
        ElseIf TitleMsg.IndexOf("压缩机故障预警") <> -1 Then
            _PortNo = 13
            'ElseIf TitleMsg.IndexOf("除霜预警") <> -1 Then
            '    _PortNo = 14
        ElseIf TitleMsg.IndexOf("压缩机运行状态") <> -1 Then
            _PortNo = 14
        ElseIf TitleMsg.IndexOf("除霜温度") <> -1 Then
            _PortNo = 15

        End If

        _ImageID = imageid
        _DataType = 3  '报警类型
        If _PortNo = 1 Then
            _TitleMsg = TipMsg & "报警:"
            '*****************************
            '20090706李吉鹏修改 增加冷库报警冷库名
        ElseIf _PortNo = 4 Then
            _TitleMsg = TipMsg & "库门1预警:"
        ElseIf _PortNo = 5 Then

            _TitleMsg = TipMsg & "库门2预警:"
        ElseIf _PortNo = 6 Then
            _TitleMsg = TipMsg & "强制制冷开启状态:"
        ElseIf _PortNo = 7 Then
            _TitleMsg = TipMsg & "强制制冷关闭状态:"
        ElseIf _PortNo = 8 Then
            _TitleMsg = TipMsg & "联动报警:"
        ElseIf _PortNo = 9 Then
            _TitleMsg = TipMsg & "除霜状态:"
            'ElseIf _PortNo = 10 Then
            '    _TitleMsg = TipMsg & "联动状态:"
        ElseIf _PortNo = 11 Then
            _TitleMsg = TipMsg & "制冷状态:"
        ElseIf _PortNo = 12 Then
            _TitleMsg = TipMsg & "机组故障预警:"
        ElseIf _PortNo = 13 Then
            _TitleMsg = TipMsg & "压缩机故障预警:"
            'ElseIf _PortNo = 14 Then
            '    _TitleMsg = TipMsg & "除霜预警:"
        ElseIf _PortNo = 14 Then
            _TitleMsg = TipMsg & "压缩机运行状态:"
        ElseIf _PortNo = 15 Then
            _TitleMsg = TipMsg & "除霜温度:"
        Else

            _TitleMsg = TitleMsg & ":"
        End If
        _TipMsg = TipMsg
        If _PortNo = 15 Then  '除霜温度数据
            _UnitMsg = "℃"
        Else
            _UnitMsg = ""

        End If
        ' _UnitMsg = ""
        _cleft = 0
        _cTop = 0
        _cWidth = 0
        _cHeight = 0

    End Sub



    Private _ProjectID As String
    Public Property ProjectID() As String
        Get
            Return _ProjectID
        End Get
        Set(ByVal value As String)
            _ProjectID = value
        End Set
    End Property

    Private _Netid As Integer
    Public Property Netid() As Integer
        Get
            Return _Netid
        End Get
        Set(ByVal value As Integer)
            _Netid = value
        End Set
    End Property

    Private _Refid As Integer
    Public Property Refid() As Integer
        Get
            Return _Refid
        End Get
        Set(ByVal value As Integer)
            _Refid = value
        End Set
    End Property


    Private _PortNo As Integer
    Public Property PortNo() As Integer
        Get
            Return _PortNo
        End Get
        Set(ByVal value As Integer)
            _PortNo = value
        End Set
    End Property

    Private _ImageID As String
    Public Property ImageID() As String
        Get
            Return _ImageID
        End Get
        Set(ByVal value As String)
            _ImageID = value
        End Set
    End Property

    Private _DataType As Integer '端口配置类型(1: 温度; 2:湿度; 3:报警; 4:库门状态)
    Public Property DataType() As Integer
        Get
            Return _DataType
        End Get
        Set(ByVal value As Integer)
            _DataType = value
        End Set
    End Property
    Private _RefType As Integer '冷库类型(1:常温库; 2:阴凉库；3：冰库；4：低温库)
    Public Property RefType() As Integer
        Get
            Return _RefType
        End Get
        Set(ByVal value As Integer)
            _RefType = value
        End Set
    End Property

    Private _TitleMsg As String
    Public Property TitleMsg() As String
        Get
            Return _TitleMsg
        End Get
        Set(ByVal value As String)
            _TitleMsg = value
        End Set
    End Property

    Private _TipMsg As String
    Public Property TipMsg() As String
        Get
            Return _TipMsg
        End Get
        Set(ByVal value As String)
            _TipMsg = value
        End Set
    End Property

    Private _UnitMsg As String
    Public Property UnitMsg() As String
        Get
            Return _UnitMsg
        End Get
        Set(ByVal value As String)
            _UnitMsg = value
        End Set
    End Property


    Private _cleft As Integer
    Public Property cLeft() As Integer
        Get
            Return _cleft
        End Get
        Set(ByVal value As Integer)
            _cleft = value
        End Set
    End Property


    Private _cTop As Integer
    Public Property cTop() As Integer
        Get
            Return _cTop
        End Get
        Set(ByVal value As Integer)
            _cTop = value
        End Set
    End Property

    Private _cWidth As Integer
    Public Property cWidth() As Integer
        Get
            Return _cWidth
        End Get
        Set(ByVal value As Integer)
            _cWidth = value
        End Set
    End Property


    Private _cHeight As Integer
    Public Property cHeight() As Integer
        Get
            Return _cHeight
        End Get
        Set(ByVal value As Integer)
            _cHeight = value
        End Set
    End Property

End Class
